home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / complib.idb / usr / share / catman / p_man / cat3 / complib / sscal2d.z / sscal2d
Text File  |  1996-03-14  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssssssccccaaaallll2222dddd,,,,ddddssssccccaaaallll2222dddd((((3333FFFF))))                                        ssssssssccccaaaallll2222dddd,,,,ddddssssccccaaaallll2222dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ssssssssccccaaaallll2222dddd,,,, ddddssssccccaaaallll2222dddd ---- scales 2D real sequence.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssssssccccaaaallll2222dddd(((( nnnn1111,,,, nnnn2222,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa))))
  14.           iiiinnnntttteeeeggggeeeerrrr            nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  15.           rrrreeeeaaaallll               aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222))))
  16.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddssssccccaaaallll2222dddd(((( nnnn1111,,,, nnnn2222,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa))))
  17.           iiiinnnntttteeeeggggeeeerrrr            nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  18.           rrrreeeeaaaallll****8888             aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222))))
  19.  
  20.      _C :
  21.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  22.      iiiinnnntttt ssssssssccccaaaallll2222dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,,
  23.                ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllddddaaaa))));;;;
  24.      iiiinnnntttt ddddssssccccaaaallll2222dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,,
  25.                ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllddddaaaa))));;;;
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      ssssssssccccaaaallll2222dddd and ddddssssccccaaaallll2222dddd scale the 2D real sequence of N1xN2 sample.
  30.      The Fourier Transforms are not normalized so the succession Direct-
  31.      Inverse transform scales the input data by a factor equal to the size of
  32.      the transform.  So ssssssssccccaaaallll2222dddd or ddddssssccccaaaallll2222dddd may be used to scale back the
  33.      result.
  34.  
  35. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  36.      NNNN1111 Integer, the first dimension size of the 2D sequence.
  37.      Unchanged on exit.
  38.  
  39.      NNNN2222 Integer, the second dimension size of the 2D sequence.
  40.      Unchanged on exit.
  41.  
  42.      AAAAllllpppphhhhaaaa scaling floating point value.
  43.  
  44.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 2D sequence to be transformed.
  45.      On input, the element {i,j} of the sequence is stored as A(i,j) in
  46.      _F_o_r_t_r_a_n , and A[i+j*lda] in _C.
  47.      On exit, the array is overwritten by its transform.
  48.  
  49.      LLLLDDDDAAAA Integer, leading dimension: increment between the samples of two
  50.      consecutive sub-sequences (e.g between {i,j+1} and {i,j} ).
  51.           Unchanged on exit.
  52.  
  53.  
  54. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  55.      Working on 64x1024 2D sequence.  We successively apply a Direct Fourier
  56.      Transform, an Inverse Fourier Transform and finally scale back the result
  57.      by a factor 1/N (1/(64*1024.))-
  58.      This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
  59.      operator and the final sequence should be equal (with round-off
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssssssccccaaaallll2222dddd,,,,ddddssssccccaaaallll2222dddd((((3333FFFF))))                                        ssssssssccccaaaallll2222dddd,,,,ddddssssccccaaaallll2222dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      precision) to the initial sequence.
  75.      The offset between the first element of two succesive sub-sequence
  76.      (leading dimension) is 1026 (1026 >= 1024+2).
  77.      _F_o_r_t_r_a_n
  78.           real array(0:1026-1,0:64-1), coeff((1024+15)+2*(64+15))
  79.           call scfft2dui( 1024, 64, coeff)
  80.           call scfft2du( -1, 1024, 64, array, 1026, coeff)
  81.           call csfft2du(  1, 1024, 64, array, 1026, coeff)
  82.           call sscal2d(1024,64,(1./real(1024*64)),array,1026)
  83.  
  84.      _C
  85.           #include <fft.h>
  86.           float array[64*1026], *coeff;
  87.           coeff = scfft2dui( 1024, 64, NULL);
  88.           scfft2du( -1, 1024, 64, array, 1026, coeff);
  89.           csfft2du(  1, 1024, 64, array, 1026, coeff);
  90.           sscal2d( 1024,64,1./(float)(1024*64),array,1026);
  91.  
  92.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  93.      Which one is used (+1 or -1) for Direct transform is just a matter of
  94.      convention-
  95.  
  96.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  97.      Direct-Inverse transform scales the input data by a factor equal to the
  98.      size of the transform.
  99.  
  100. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  101.      fft, scfft2dui, dzfft2dui, scfft2du, dzfft2du, csfft2du, zdfft2du,
  102.      sprod2du, dprod2du
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.